<template>
    <div class="user">
        <!-- 左侧导航区域 -->
        <div class="menu">
            <div class="top">
                <el-icon>
                    <HomeFilled />
                </el-icon>
                <span> / 会员中心</span>
            </div>
            <el-menu class="el-menu-vertical-demo" :default-active="$route.path">
                <el-menu-item index="/user/certification" @click="changeActive('/user/certification')">
                    <el-icon><icon-menu /></el-icon>
                    <span>实名认证</span>
                </el-menu-item>
                <el-menu-item index="/user/order" @click="changeActive('/user/order')">
                    <el-icon>
                        <document />
                    </el-icon>
                    <span>挂号订单</span>
                </el-menu-item>
                <el-menu-item index="/user/patient" @click="changeActive('/user/patient')">
                    <el-icon>
                        <setting />
                    </el-icon>
                    <span>就诊人管理</span>
                </el-menu-item>
                <el-menu-item index="/user/profile" @click="changeActive('/user/profile')">
                    <el-icon>
                        <InfoFilled />
                    </el-icon>
                    <span>账号信息</span>
                </el-menu-item>
                <el-menu-item index="/user/feedback" @click="changeActive('/user/feedback')">
                    <el-icon>
                        <Search />
                    </el-icon>
                    <span>意见反馈</span>
                </el-menu-item>
            </el-menu>
        </div>

        <!-- 右侧内容展示区域:路由组件展示位置 -->
        <div class="content">
            <!-- 子组件展示结构地方 -->
            <router-view></router-view>
        </div>
    </div>
</template>
<script setup lang="ts">
import { Document, Menu as IconMenu, Setting, InfoFilled, Search, HomeFilled } from "@element-plus/icons-vue";
import { onMounted } from "vue";
import { useRouter, useRoute } from "vue-router";
let $router = useRouter();
let $route = useRoute();
const changeActive = (path: string) => {
    //跳转到对应二级路由
    $router.push({ path, query: { hoscode: $route.query.hoscode } });
};
onMounted(() => {
});
</script>

<style lang="scss" scoped>
.user {
    display: flex;
    .menu {
        flex: 1.5;
        display: flex;
        flex-direction: column;
        align-items: center;

        .top {
            color: #7f7f7f;
            margin-bottom: 20px;
        }
    }

    .content {
        flex: 10;
    }
}
</style>